<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	<!---->
					<h1>
						<span class="action-span">
							<a href="#">添加新商品</a>
						</span>
						<span class="action-span1">
							<a href="#">ECSHOP 管理中心</a> 
						</span>
<span id="search_id" class="action-span1"> - 商品列表 </span>
<!-- 商品管理 -->
<span class="help_sub"><a target="_blank" title="商品列表帮助文档" href="#"><img src="../images/jnsy.png"></a></span>


					</h1>
			<!---->
			<div class="form-div">
				<img src="../images/icon_search.gif" alt="SEARCH" width="26" height="22" border="0">
				<!--分类-->
				<select name="cat_id">
					<option value="0" selected="selected">所有分类</option>
					<option value="132">钻石</option>
					<option value="190">&nbsp;&nbsp;&nbsp;&nbsp;衬衫</option>
					<option value="193">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;短袖衬衫</option>
					<option value="194">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;长袖衬衫</option>
					<option value="170">&nbsp;&nbsp;&nbsp;&nbsp;裤子</option>
					<option value="173">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;休闲裤</option>
					<option value="623">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;休闲短裤</option>
				</select>
				<!--品牌-->
				<select name="brand_id">
					<option value="0" selected="selected">所有品牌</option>
					<option value="44">kk</option>
					<option value="32">溢彩年华</option>
					<option value="31">EVENY</option>
					<option value="30">圣迪奥</option>
					<option value="29">韩都衣舍</option>
					<option value="28">betu百图</option>
					<option value="27">艾夫斯</option>
				</select>
				<!--推荐-->
				<select name="intro_type">
					<option value="0" selected="selected">全部</option>
					<option value="is_best">精品</option>
					<option value="is_new">新品</option>
					<option value="is_hot">热销</option>
					<option value="is_promote">特价</option>
					<option value="all_type">全部推荐</option>
				</select>
				<!--上架-->
				<select name="is_on_sale">
					<option value="" selected="selected">全部</option>
					<option value="1">上架</option>
					<option value="0">下架</option>
				</select>
				<!-- 关键字 -->
				关键字 <input name="keyword" size="15" type="text">
				<input value=" 搜索 " class="button" type="submit">
				<!--商品列表-->
			<div class="list-div" id="listDiv">
				<table cellspacing="1" cellpadding="3">
					<tbody id="goods_">
						<tr>
							<th>
								<input type="checkbox">
								<a href="javascript:;">编号</a><img src="../images/sort_desc.gif"> </th>
							<th>
								<a href="javascript:;">商品名称</a>
							</th>
							<th>
								<a href="javascript:;">货号</a>
							</th>
							<th>
								<a href="javascript:;">价格</a>
							</th>
							<th>
								<a href="javascript:;">上架</a>
							</th>
							<th>
								<a href="javascript:;">精品</a>
							</th>
							<th>
								<a href="javascript:);">新品</a>
							</th>
							<th>
								<a href="javascript:;">热销</a>
							</th>
							<th>
								<a href="javascript:;">推荐排序</a>
							</th>
							<th>
								<a href="javascript:;">库存</a>
							</th>
							<th>
								<a href="javascript:;" title="点击对列表排序">虚拟销量</a>
							</th>
							<th>操作</th>
						</tr>
						<!---->
						<tr class="shops">
							
							<td><input name="checkboxes" value="143" type="checkbox">143</td>
							<td class="first-cell"><span onclick="change(this,'act')">暖怀－白18K金钻石戒指</span></td>
							<td align="center"><span onclick="change(this,'act')">ECS000143</span></td>
			<td  align="center"><span onclick="change(this,'act')" title="点击修改内容" style="">0.00
    </span></td>
    
							<td align="center"><img src="../images/no.gif" onclick=""></td>
							<td align="center"><img src="../images/yes.gif" onclick=""></td>
							<td align="center"><img src="../images/no.gif" onclick=""></td>
							<td align="center"><img src="../images/yes.gif" onclick=""></td>
							<td align="center"><span onclick=" ">100</span></td>
							<td align="center"><span onclick="">1</span></td>
							<td align="center"><span onclick="#">0</span></td>
							<td align="center">
								<a href="#"  title="查看">
									<img src="../images/icon_view.gif" width="21" height="21" border="0">
								</a>
								<a href="#" title="编辑">
									<img src="../images/icon_edit.gif" width="21" height="21" border="0">
								</a>
								<a href="javascript:;" title="复制" onclick="clone(this),changNum()">
									<img src="../images/icon_copy.gif" width="21" height="21" border="0">
								</a>
								<a href="javascript:;" onclick="remove(this),changNum()" title="回收站">
									<img src="../images/icon_trash.gif" width="21" height="21" border="0">
								</a>
								<img src="../images/empty.gif" width="21" height="21" border="0"> </td>
						</tr>
											<!---->
						<tr class="shops">
							
							<td><input name="checkboxes" value="143" type="checkbox">143</td>
							<td class="first-cell"><span onclick="change(this,'act')">暖怀－白18K金钻石戒指</span></td>
							<td align="center"><span onclick="change(this,'act')">ECS000143</span></td>
			<td  align="center"><span onclick="change(this,'act')" title="点击修改内容" style="">0.00
    </span></td>
    
							<td align="center"><img src="../images/no.gif" onclick=""></td>
							<td align="center"><img src="../images/yes.gif" onclick=""></td>
							<td align="center"><img src="../images/no.gif" onclick=""></td>
							<td align="center"><img src="../images/yes.gif" onclick=""></td>
							<td align="center"><span onclick=" ">100</span></td>
							<td align="center"><span onclick="">1</span></td>
							<td align="center"><span onclick="#">0</span></td>
							<td align="center">
								<a href="#"  title="查看">
									<img src="../images/icon_view.gif" width="21" height="21" border="0">
								</a>
								<a href="#" title="编辑">
									<img src="../images/icon_edit.gif" width="21" height="21" border="0">
								</a>
								<a href="#" onclick="clone(this),changNum()" title="复制">
									<img src="../images/icon_copy.gif" width="21" height="21" border="0">
								</a>
								<a href="javascript:;" onclick="remove(this),changNum()" title="回收站">
									<img src="../images/icon_trash.gif" width="21" height="21" border="0">
								</a>
								<img src="../images/empty.gif" width="21" height="21" border="0"> </td>
						</tr>
						<!---->
					</tbody>
				</table>
				<script>
					
				</script>
			</div>
			</div>
			<!-- 分页 -->
				<table id="page-table" cellspacing="0">
					<tbody>
						<tr>
							<td style="background-color: rgb(255, 255, 255);" nowrap="true" align="right">							
								<div id="turn-page">
									总计 <span id="totalRecords"></span> 个记录分为 <span id="totalPages">1</span> 页当前第 <span id="pageCurrent">1</span> 页，每页 <input size="3" id="pageSize" value="15" onkeypress=" " type="text">
									<span id="page-link">
          <a href="javascript: )">第一页</a>
          <a href="javascript: ">上一页</a>
          <a href="javascript: ">下一页</a>
          <a href="javascript: ">最末页</a>
          <select id="gotoPage" onchange="listTable.gotoPage(this.value)">
            <option value="1" selected="selected">1</option>          </select>
        </span>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
				<!---->
				<div>				
				<select name="type" id="selAction" onchange="">
					<option value="" selected="selected">请选择...</option>
					<option value="trash">回收站</option>
					<option value="on_sale">上架</option>
					<option value="not_on_sale">下架</option>
					<option value="best">精品</option>
					<option value="not_best">取消精品</option>
					<option value="new">新品</option>
					<option value="not_new">取消新品</option>
					<option value="hot">热销</option>
					<option value="not_hot">取消热销</option>
					<option value="move_to">转移到分类</option>
				</select>
				<input name="extension_code" value="" type="hidden">
				<input value=" 确定 " id="btnSubmit" name="btnSubmit" class="button" disabled="true" type="submit">
			</div>
					<!---->
			<div id="footer">
			共执行 7 个查询，用时 0.022002 秒，Gzip 已禁用，内存占用 3.548 MB<br> 版权所有 © 2005-2018 上海商派软件有限公司，并保留所有权利。</div>
	</body>
</html>
<script>
$(function(){
	
	/*总计*/
//console.log($(".shops").length)

changNum = function (){
	var str = $(".shops").length;
$("#totalRecords").html(str);
$("#num2").html(str);
}

/************************************/
clone = function(obj){
	console.log($(obj).parent().parent().clone())
	$(obj).parent().parent().clone().appendTo($(obj).parent().parent().parent())
}
/********************************************************/

		$.ajax({
			url: "/api/goods_find",
			type: "post",
			success: function(res) {
				var resc = res.length;
			for(var i = 0;i < resc;i ++){	
				var goods_name = res[i].goods_name;
				var price = res[i].price;
				console.log(res[i]);
var str = '<tr class="shops"><td><input name="checkboxes" value="143" type="checkbox">143</td><td class="first-cell"><span onclick="change(this,"act")">'+goods_name+'</span></td><td align="center"><span onclick="change(this,"act")">ECS000143</span></td><td  align="center"><span onclick="change(this,"act")" title="点击修改内容" style="">'+price+'</span></td><td align="center"><img src="../images/no.gif"onclick=""></td><td align="center"><img src="../images/yes.gif" onclick=""></td><td align="center"><img src="../images/no.gif" onclick=""></td><td align="center"><img src="../images/yes.gif" onclick=""></td><td align="center"><span onclick=" ">100</span></td><td align="center"><span onclick="">1</span></td><td align="center"><span onclick="#">0</span></td><td align="center"><a href="#"  title="查看"><img src="../images/icon_view.gif" width="21" height="21" border="0"></a><a href="#" title="编辑"><img src="../images/icon_edit.gif" width="21" height="21" border="0"></a><a href="javascript:;" title="复制" onclick="clone(this),changNum()"><img src="../images/icon_copy.gif" width="21" height="21" border="0"></a><a href="javascript:;" onclick="remove(this),changNum()" title="回收站"><img src="../images/icon_trash.gif" width="21" height="21" border="0"></a><img src="../images/empty.gif" width="21" height="21" border="0"></td></tr>'
					//console.log(str)	
						
			  $("#goods_").append(str);
			  	var str = $(".shops").length;
$("#totalRecords").html(str);
	var str = $(".shops").length;
$("#num2").html(str);
			}
		}
		})

	
})
	
</script>


